<!doctype html>
<html lang="zh-cn">
<head>
	<meta charset="UTF-8">
	<title>个人中心</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<link rel="stylesheet" href="../../css/public-heder-Reset.css">
	<link rel="stylesheet" href="../../css/Ucenter.css">
</head>
<body>
	<!-- page_box -->
	<div class="page-box">
		<!-- header -->
		<header class="header">
			<div class="U-state clear">
				<span class="name fl">尊敬的客户<i id="name"></i>您好！</span>
				<span class="out fr">退出</span>
			</div>
			<div class="profit">
				<p>累计收益（元）</p>
				<span id="profit">0.00元</span>
			</div>
			<div style="text-align:center;font-size:15px;margin-top:10px;">
				<p>存钱罐收益：<span id="bonus">0.00</span></p>
			</div>
			<div class="nav clear">
				<a>
					<span>持有资产</span>
					<i id="have">0.00元</i>
				</a>
				<a>
					<span>待收本金</span>
					<i id="willcorpus">0.00元</i>
				</a>
				<a>
					<span>待收收益</span>
					<i id="willprofit">0.00元</i>
				</a>
			</div>
		</header>
		<!-- header -->	
		<!-- U-list -->
		<div class="U-list">
			<div class="Recharge-cash clear">
				<div class="balance fl" onclick="window.location.href='U-account-analysis.html'">
					<span>账户余额（元）</span>
					<p id="canuse">0.00元</p>
				</div>
				<div class="btn fl">
					<div class="bt-cz">
						<button onclick="testTtate('/api/user/fb/card/pay','U-Recharge.html');">充值</button>
					</div>
					<div class="bt-tx">
						<button onclick="testTtate('/api/user/fb/card/pay','U-Withdrawals.html');">提现</button>
					</div>
				</div>
			</div>
			<div class="u-set">
				<a href="U-MyProjects.html"><span class="projcet"></span><p>我的项目</p><i></i></a>
				<a href="U-TransactionDetail.html"><span class="transaction"></span><p>交易明细</p><i></i></a>
				<a href="Uaccount.html"><span class="account"></span><p>账户管理</p><i></i></a>
				<a href="U-agent.html" class="oneAgent" style="display:none;"><span class="customer"></span><p>经纪人管理</p><i></i></a>
				<a href="customer.html" class="agent" style="display:none;"><span class="customer"></span><p>客户管理</p><i></i></a>
				<a href="business.html" class="agent" style="display:none;"><span class="business"></span><p>业务管理</p><i></i></a>
				<a href="U-gift.html"><span class="gift"></span><p>红包管理</p><i></i></a>
				<a href="U-inforList.html"><span class="news"></span><p>消息管理</p><i></i></a>
			</div>
		</div>
		<!-- U-list / -->
		<!-- foot nav fixed -->
		<footer class="fixed-nav">
			<a  class="selected " href="../index.html"><i></i><span>精选</span></a>
			<a  class="investment" href="../InvestmentDetails/Project-list.html"><i></i><span>投资</span></a>
			<a  class="wealth active" href=""><i></i><span>财富</span></a>
			<a  class="more" href="../More/M-more.html"><i></i><span>更多</span></a>
		</footer>
		<!-- foot nav fixed /-->
		<!-- registerRed fixed -->
		<!-- 注册成功 跳转用户页面 显示红包 -->
		<div class="registerRed">
			<div class="red">
				<h4 class="gift_text">恭喜获得<strong class="gift_money">0.00</strong>元红包</h4>
				<span class="back" id="back"></span>
				<button onclick="window.location.href='../InvestmentDetails/Project-list.html'">马上投资</button>
			</div>
		</div>
		<!-- registerRed fixed / -->

		<!-- isout -->
		<div class="isout">
			<div class="isok">
				<p>是否确认退出登录?</p>
				<button class="back" style="">返回</button>
				<button class="ok" style="">确认</button>
			</div>
		</div>
		<!-- isout /-->
	</div>	
	<!-- page_box /-->
	<script type="text/javascript" src="../../js/jquery.min.js"></script>
	<script type="text/javascript" src="../../js/http-url.js"></script>
	<script type="text/javascript">
		// 退出按钮点击事件
			$('.U-state').find('.out').click(function(){
				$('.isout').show();
				testShow('.isout')//检查遮罩是否隐藏 显示
			});
		$(function(){
			ajaxRequest('/api/menu',null,function(data){
				// 显示用户资金;
				$('.U-state').css('display','block');
				$('.U-state').find('.name').find('i').text(data.data.ledname);
				$('.header').find('.profit').find('span').text(data.data.profit+'元');
				$('#have').text(data.data.frostmoney+'元');
				$('#willcorpus').text(data.data.willcorpus+'元');
				$('#willprofit').text(data.data.willprofit+'元');
				$('#bonus').text(data.data.bonus+'元');
				$('.U-list').find('.balance').find('p').text(data.data.money+'元');
				// 角色判断
				for(var i=0;data.data.role.length>i;i++){
					if(data.data.role[i]=='Agent'){
						$('.oneAgent').show();
						$('.agent').show();
					}
				}
				if(data.data.user_info.invite_code==data.data.user_info.second_broker_code){
					$('.agent').show();
				}
				//注册送红包
				if(data.data.R_gift){
					$('.registerRed').show();
					$('.gift_money').text(data.data.R_gift);
				}
			},true);
			testShow('.registerRed')//检查遮罩是否隐藏 显示
			//红包取消按钮点击事件
			$("#back").on("touchend", function (event) {
			   $(".registerRed").hide();
			   testShow('.registerRed')//检查遮罩是否隐藏 显示
			   event.preventDefault();//阻止冒泡事件
			 });
			//取消退出登录按钮点击事件
			$(".isout .back").on("touchend", function (event) {
			    $(".isout").hide();
			    testShow('.isout')//检查遮罩是否隐藏 显示
			    event.preventDefault();//阻止冒泡事件
			 });
		
			// 确认退出登录
			$('.isout').find('.ok').click(function(){
				ajaxRequest('/api/logout',null,function(data){
					window.localStorage.removeItem('phone_number');
				    window.localStorage.removeItem('password');
					window.location.href='../login.html'
				},false)
			});
			});
	</script>
</body>
</html>